#include "../core/engine/engine.h"
#include "billboard.h"

namespace sleek
{
    namespace node
    {
        namespace billboard
        {
            Billboard::Billboard(core::engine::engine *smgr) : Node(smgr), ctr(true)
            {
                scl = core::math::vector2df(sca.x, sca.y);
            }
            void Billboard::center(bool a)
            {
                ctr = a;
            }
            void Billboard::setScale(core::math::vector3df a)
            {
                Node::setScale(a);
                scl = core::math::vector2df(a.x, a.y);
            }
            bool Billboard::center()
            {
                return ctr;
            }
            void Billboard::render()
            {
                Node::render();
                scl = core::math::vector2df(sca.x, sca.y);
                mat.getTexture(0) ? (ctr ? smgr->getDrawManager()->drawTextureCenter(mat.getTexture(0), pos, rot, scl) :
                             smgr->getDrawManager()->drawTexture(mat.getTexture(0), pos, rot, scl)) : void();
            }
        }
    }
}
